<template>
	<view>
		<div id="user_data">	
		    <ul>		
		        <li class="data" @click="uni.navigateTo({
							url:'avatar?url='+ `${config.baseUrl}`+info.photo
						})">						
					<span>头像</span>									
					<img :src="getImgUrl(info.photo)">									
		        </li>
		        <li class="data">				          
		              <span>昵称</span>
					  <p>{{info.name}}</p>         
		        </li>
		        <li class="data" @click="goemail()">	            
					<span>邮箱</span>
					<i class="am-icon-chevron-right"></i>
					<p>{{info.email}}</p>
		        </li>
				<li class="data" @click="gotelephone()">	            
		                <span>手机号</span>
		                <i class="am-icon-chevron-right"></i>
		                <p>{{info.phone}}</p>
		        </li>
				<li class="data" @click="gosignature()">			   
				        <span>个性签名</span>
				       <i class="am-icon-chevron-right"></i>
				        <p>{{info.individualitysignature}}</p>						  
				</li>		        
		    </ul>
		</div>
	</view>
</template>

<script>
	import config from '@/config'
	export default {
		data() {
			return {
				config,
				uni,
				u:{
					photo:""
				},
				info:{
					
				}
			}
		},
		methods: {
			getImgUrl:function(image){//获取图片，图片地址拼接函数
					return `${config.baseUrl}`+image;
				},	
			onLoad:function(options){
				var that = this;
				uni.request({
					url: `${config.baseUrl}/my/info?token=`+uni.getStorageSync('token'),
					method: 'POST',
					success(r) {
						if (r.data.succ) {						
							that.info = r.data.data;
							console.log(r.data);
						} else {

						}
					}
				})
			},
			backuser: function () {
				uni.navigateTo({//跳转我的页面
				    url: '../user_center',		
				});
			},
			goheadphoto: function () {
				uni.navigateTo({//跳转修改头像页面
				    url: '',		
				});
			},
			goemail: function () {
				uni.navigateTo({//跳转修改邮箱页面
				    url: './email',		
				});
			},
			gotelephone: function () {
				uni.navigateTo({//跳转修改手机号页面
				    url: './telephone',		
				});
			},
			gosignature: function () {
				uni.navigateTo({//跳转修改个签页面
				    url: './signature',		
				});
			}
		}
	}
</script>

<style>

</style>
